package com.dy.sucetity.utils;

import com.dy.sucetity.constant.ResultEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @Author: ding-yu
 * @Date: 2022/5/19 9:06
 * @Desctiption: (描述)
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class ApiResult<T> {

    private Integer result;
    private String msg;
    private T data;

    public static<T> ApiResult<T> rs(ResultEnum result, String msg, T data){
        ApiResult<T> r = new ApiResult<>();
        r.result=result.getCode();
        r.msg=msg;
        r.data=data;
        return r;
    }


}
